<!doctype html>
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>我的帖子</title>
<link href="../../css/newStyle.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../js/header&footer.js"></script>
<script type="text/javascript" src="../../js/gbRst.js"></script>
<script type="text/javascript" src="../../js/utils.js"></script>
<script type="text/javascript" src="../../js/openId.js"></script>
<script type="text/javascript" src="../../js/check.js"></script>
<script type="text/javascript" src="../../js/qmsk-1.2.js"></script>
<script type="text/javascript" src="../../js/jquery.qqFace.js"></script>
<script type="text/javascript">
var memberId = 0;
var memberName= "游客";
var imageUrl = "../../images/userImg.jpg";
$(function(){
	var  member=_findInfo("../../../member/find/shopId/"+getShopId()+"/openId/"+getOpenId(), null)
	if(IsNotEmpty(member)&&member.state==0){
		memberId=getHtmlString(getHeadIndexValue(0, member, "memberId"));
		memberName=getHtmlString(getHeadIndexValue(0, member, "CustomerName"));
	}
 	getNotes()
})

function getNotes(){
	 new qmsk.SiglePinterest({
			url : '../../../notes/find/noteList', // 请求地址，插件会自动在 url 后追加 /n/n
			initPage : 1, // 首次加载页数
			size : 10, // 每次加载数量，即每页的大小
			success : printDataToPage, // 成功回调
			valves : 100 ,//当滚动条距离底部该像素的时候加载
			data:{'shopId':_shopId,'memberId':memberId,'ownId':memberId},
			loading : addRefresh2,
			loaded : delRefresh,
			emptyHandler :showNoResult
		});
}
function showNoResult(){
	$("#noResult").show()
}

function parise(id){
	if(IsEmpty(memberId)){
		alert("您还不是会员")
		return false;
	}
 	if(!$("#parise_"+id).hasClass("wonderful")){
 		var heads = new Array("noteId","memberId")
 		var datas = new Array(id,memberId)
 		var params= _getJsonParseInsertStr(heads, datas);
 		var dt = _insertInfoNoSucceedMessage("../../../notes/insert/insertParise", {'data':params})
 		if(IsNotEmpty(dt)&&dt.state==0){
 	 		var num= getHtmlInt($("#parise_"+id).next("b").html()) ;	
 	 		num++;
 	 		$("#parise_"+id).next("b").html(num)
 	 		$("#parise_"+id).addClass("wonderful");	
 		}
		}	
}


function printDataToPage(dt){
	var urlThml="&openId="+_openId+"&shopId="+_shopId;
	for(var i = 0;i<dt.row;i++){
		var htm="<div id=\"note_"+dt.getValue("id",i)+"\" class=\"comeGift\"><header><dl><dt><img src=\"../../images/userImg.jpg\"></dt><dd><strong>"+dt.getValue("customerName",i)+"</strong><br><time>"+dt.getValue("createdTime",i)+"</time></dd></dl><aside><b></b><span>"+dt.getValue("memo",i)+"</span><span class=\"red\"></span></aside></header><section>"
		var id= dt.getValue('id',i)
		var imagesList= _findInfo('../../../notes/find/imageList', {'id':id})
		if(IsNotEmpty(imagesList)&&imagesList.state==0){
			var x = imagesList.result.data.length
		if(x>0){
			
		htm+="<figure data-count=\""+x+"张图片\"><div>";
		for(var j=0;j<x;j++){
		htm+="<img src=\""+getHtmlInt(getHeadIndexValue(j, imagesList, "imageUrl"))+"\" data-src=\""+getHtmlInt(getHeadIndexValue(j, imagesList, "imageUrl"))+"\" data-gid=\"g0\" onload=\"preViewImg(this, event);\">"
		}
		htm+="</div></figure>";
		}	

		}
		htm+="<h4 class=\"title abbTit\">"+ dt.getValue("title",i)+"</h4>"+
		"<p class='abb'>"+replace_em (dt.getValue("content",i))+"</p>"+
		"<div class=\"lookDel\"><a href=\"discuss.html?id="+dt.getValue("id",i)+urlThml+"\">查看全文</a><span class=\"garbage\" onclick=\"showTestDel("+dt.getValue("id",i)+")\"></span></div></section><footer><ul><li><span class=\"look\"></span><b>"+dt.getValue("nums",i)+"</b></li><li onClick=\"redirectUrl('discuss.html?id="+dt.getValue("id",i)+urlThml+"')\"><span class=\"reply\"></span><b>"+dt.getValue("discussNums",i)+"</b></li>"
		var mId = dt.getValue("memberId",i)
		if(IsNotEmpty(mId)){
		htm+="<li id='li_"+dt.getValue("id",i)+"' onclick='parise("+dt.getValue("id",i)+")'><span id='parise_"+dt.getValue("id",i)+"' class=\"good wonderful\"></span><b>"+dt.getValue("praiseNums",i)+"</b></li></ul></footer></div>";
		}else{
			htm+="<li id='li_"+dt.getValue("id",i)+"' onclick='parise("+dt.getValue("id",i)+")'><span id='parise_"+dt.getValue("id",i)+"' class=\"good\"></span><b>"+dt.getValue("praiseNums",i)+"</b></li></ul></footer></div>";
		}
		$("#info").append(htm)
	}
	}

function deleteInfo(id){
	var dt= _deleteInfo("../../../notes/del", {'id':id})
	if(IsNotEmpty(dt)&&dt.state==0){
		$("#note_"+id).remove();
	}
}
</script>
</head>

<body>
<div class="wrapper">
  <div class="placeTit"><a class="back" href="javascript:history.go(-1)"></a>我的帖子</div>
<div class="noData" id="noResult" style="display: none;">
  <p class="Datatips">您还没有帖子哦！</p>
</div>
  <div class="container" id="info">
   <!--  <div class="comeGift">
      <header>
        <dl>
          <dt><img src="../../images/userImg.jpg"></dt>
          <dd><strong>冰</strong><br>
            <time>2012-03-20 12:00</time>
          </dd>
        </dl>
        <aside><b></b><span>宝马</span><span class="red">3000</span>公里</aside>
      </header>
      <section>
        <figure data-count="6张图片">
          <div> <img src="../../images/host1.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host2.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host3.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host4.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host5.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host6.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> </div>
        </figure>
        <h4 class="title abbTit">绵阳主播</h4>
        <p class="abb">价位哦IF奖陪我i减肥品味EFI金额为盲从口味快递费，建文件fine我veowsiv</p>
        <div class="lookDel"><a href="discuss.html">查看全文</a><span class="garbage"></span></div></section>
      <footer>
        <ul>
          <li><span class="look"></span><b>0</b></li>
          <li><span class="reply" onClick="redirectUrl('discuss.html')"></span><b>20</b></li>
          <li><span class="good"></span><b>10</b></li>
        </ul>
      </footer>
    </div>
    <div class="comeGift">
      <header>
        <dl>
          <dt><img src="../../images/userImg.jpg"></dt>
          <dd><strong>冰</strong><br>
            <time>2012-03-20 12:00</time>
          </dd>
        </dl>
        <aside><b></b><span>宝马</span><span class="red">3000</span>公里</aside>
      </header>
      <section>
        <figure data-count="6张图片">
          <div> <img src="../../images/host1.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host2.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host3.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host4.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host5.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> <img src="../../images/host6.jpg" data-src="http://img.weimob.com/67/05/d7/sns/20140313205136_49500.jpg" data-gid="g0" onload="preViewImg(this, event);"> </div>
        </figure>
        <h4 class="title abbTit">绵阳主播</h4>
        <p class="abb">价位哦IF奖陪我i减肥品味EFI金额为盲从口味快递费，建文件fine我veowsiv</p>
        <div class="lookDel"><a href="discuss.html">查看全文</a><span class="garbage"></span></div></section>
      <footer>
        <ul>
          <li><span class="look"></span><b>0</b></li>
          <li><span class="reply" onClick="redirectUrl('discuss.html')"></span><b>20</b></li>
          <li><span class="good"></span><b>10</b></li>
        </ul>
      </footer> -->
    </div>
  </div>
</div>
</body>
</html>
